FROM python:3.12-alpine
LABEL image.authors="YangKe"
WORKDIR /usr/src/app/config

# 合并所有安装和配置命令
RUN pip install yangke && \
    mkdir -p /usr/src/app/config && \
    echo $'import yangke\n\
yangke.start_restful_mysql(cors=False)\n' > /usr/src/app/config/start_mysql.py

VOLUME ["/usr/src/app/config"]

CMD ["python", "start_mysql.py"]

